//
// Created by Administrator on 2023/7/28.
//
#include <vector>
#include <string>
#include <iostream>

using namespace std;

class Solution {
public:
    int prefixCount(vector<string> &words, string pref) {
        int count = 0;
        for (string &word: words) {
            // word是不是以pref为前缀
            if (word.find(pref) == 0)
                count++;
        }
        return count;
    }
};

int main() {
    vector<string> words{"pay", "attention", "practice", "attend"};
    Solution s;
    cout << s.prefixCount(words, "at") << endl;
}